package ZY10_25.Graph;

public class Graph {
    private static double π=3.14;
    public double show(double a,double b){
        double c=2*(a+b);
        double s=a*b;
        if (a==b){
            System.out.println("是正方形");
        }else if (a>b||a<b){
            System.out.println("是长方形");
        }
        System.out.println("周长："+c+" 面积："+s);
        return c+s;
    }
    public double show(double a,double b,double c){
        double s = (a + b + c);
        double n=s*(s-a)*(s-b)*(c);
        double m=Math.sqrt(n);
        System.out.println("三角形面积是"+m);
        System.out.println("三角形周长是"+s);
        return s+n;
    }
    public double show(double r){
        double s=(π*r*r);
        double c=2*(π*r);
        System.out.println("面积："+s+" 周长："+c);
        return s+c;
    }
}
